<html xmlns="http://www.w3c.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<script type="text/javascript">
		//<![CDATA[
		//debe usarse los \\:  en lugar de : en los selectores de JQuery
		$(document).ready(function() {
			wizardSetCurrentPageStyle('form_wizard:farmData');

		});
		//]]>
	</script>
</h:head>
<h:body>
	<h:form id="form_farm_data">
		<h2>
			<h:outputLabel value="#{i18n['lbl.owner.farm_general_data.title']}" />
		</h2>
		
	
		<div class="clearfix common-panel">
			<div class="ui-form-row-2col clearfix">
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel value="#{i18n['lbl.owner.farm_general_data.farm']}" />
					</div>
					<div class="clearfix text-align-left">
						<p:selectOneRadio value="#{aSession.selectedRuatRegister.farm}" disabled="true">
							<f:selectItem itemLabel="Si" itemValue="1" />
							<f:selectItem itemLabel="No" itemValue="2" />
						</p:selectOneRadio>
					</div>
				</div>
				<div class="ui-form-col"></div>
			</div>
			<div class="ui-form-row-3col clearfix">
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel
							value="#{i18n['lbl.owner.farm_general_data.farm_name']}" />
					</div>
					<div class="clearfix text-align-left">
						<p:inputText value="#{aSession.selectedRuatRegister.farmName}" required="true"/>
					</div>
				</div>
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel
							value="#{i18n['lbl.owner.farm_general_data.catastral_identification']}" />
					</div>
					<div class="clearfix text-align-left">
						<p:inputText
							value="#{aSession.selectedRuatRegister.catastralIdentification}" required="true"/>
					</div>
				</div>
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel
							value="#{i18n['lbl.owner.farm_general_data.farm_tenure']}" />
					</div>
					<div class="clearfix text-align-left">
						<p:selectOneMenu
							value="#{aSession.selectedRuatRegister.farmTenure}" required="true">
							<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
								itemValue="" noSelectionOption="true"/>
							<f:selectItems value="#{farmTenureCmb.parameterDTO.options}" />
								<f:selectItem itemLabel="#{i18n['cmpnt.other']}"
									itemValue="3"  />							
						</p:selectOneMenu>
					</div>
				</div>
			</div>

		</div>
		<legend>
			<h:outputLabel
				value="#{i18n['lbl.owner.farm_general_data.lbl_place']}" />
		</legend>
		<div class="clearfix common-panel">
			<p:panel id="locationsFarm" styleClass="clearfix">
				<!-- 			<div class="ui-form-row-3col clearfix"> -->
				<div class="ui-form-row-2col clearfix">
					<div class="ui-form-col">
						<div class="clearfix text-align-left">
							<h:outputLabel
								value="#{i18n['lbl.owner.farm_general_data.farm_department']}" />
						</div>
						<div class="clearfix text-align-left">
							<p:selectOneMenu
								value="#{aSession.selectedRuatRegister.farmDepartament}" required="true">
								<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
									itemValue="" noSelectionOption="true"/>
								<f:selectItems value="#{farmLocationController.departments}" />
								<p:ajax event="change" update="locationsFarm"
									listener="#{farmLocationController.toogleDeparment}" />
							</p:selectOneMenu>
						</div>
					</div>
					<div class="ui-form-col"></div>
				</div>
				<div class="ui-form-row-2col clearfix">
					<div class="ui-form-col">
						<div class="clearfix text-align-left">
							<h:outputLabel
								value="#{i18n['lbl.owner.farm_general_data.farm_municipality']}" />
						</div>
						<div class="clearfix text-align-left">
							<p:selectOneMenu
								value="#{aSession.selectedRuatRegister.farmMunicipality}" required="true">
								<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
									itemValue="" noSelectionOption="true"/>
								<f:selectItems value="#{farmLocationController.municipalities}" />
								<p:ajax event="change" update="locationsFarm"
									listener="#{farmLocationController.toogleMunicipality}" />
							</p:selectOneMenu>
						</div>
					</div>
					<div class="ui-form-col">
						<div class="clearfix text-align-left">
							<h:outputLabel
								value="#{i18n['lbl.owner.farm_general_data.farm_village']}" />
						</div>
						<div class="clearfix text-align-left">
							<p:selectOneMenu
								value="#{aSession.selectedRuatRegister.farmVillage}" required="true">
								<f:selectItem itemLabel="#{i18n['cmpnt.select_one']}"
									itemValue="" noSelectionOption="true"/>
								<f:selectItems value="#{farmLocationController.villages}" />
								<p:ajax event="change" update="locationsFarm"
									listener="#{farmLocationController.toogleVillage}" />
							</p:selectOneMenu>
						</div>
					</div>
				</div>
				<div class="ui-form-row-3col clearfix">
					<div class="ui-form-col">
						<div class="clearfix text-align-left">
							<h:outputLabel
								value="#{i18n['lbl.owner.farm_general_data.farm_sector']}" />
						</div>
						<div class="clearfix text-align-left">
							<p:inputText value="#{aSession.selectedRuatRegister.farmSector}" required="true"/>
						</div>
					</div>
					<div class="ui-form-col"></div>
					<div class="ui-form-col"></div>
				</div>
			</p:panel>
		</div>
		<div class="clearfix common-panel">
			<div class="ui-form-row-2col clearfix">
				<div class="ui-form-col">
					<div class="clearfix text-align-left">
						<h:outputLabel value="#{i18n['lbl.owner.farm_general_data.area']}" />
					</div>
					<div class="clearfix text-align-left">
						<p:inputText
							value="#{aSession.selectedRuatRegister.farmTotalArea}" required="true"/>
					</div>
				</div>
				<div class="ui-form-col"></div>
			</div>
		</div>

		<div class="buttons-container clearfix text-align-right">
			<p:commandButton value="#{i18n['lbl.flow_button.cancel']}"
				styleClass="ui-flowbutton"
				oncomplete="currentPage('list_owner_data.xhtml')"
				actionListener="#{stepByStepController.cancelRuatRegister}" />
			<p:commandButton value="#{i18n['lbl.flow_button.back']}"
				oncomplete="setCurrentPageStyle(xhr, status, args,this)"
				styleClass="ui-flowbutton" update="form_farm_data"
				actionListener="#{stepByStepController.viewAssociativityDataB}" />
			<p:commandButton value="#{i18n['lbl.flow_button.save_and_next']}"
				oncomplete="setCurrentPageStyle(xhr, status, args,this)"
				styleClass="ui-flowbutton" validateClient="true"
				update="form_farm_data"
				actionListener="#{stepByStepController.viewFarmDataB}"  
				id="savenext" />
		</div>
		<p:blockUI block="savenext" trigger="savenext"/>
	</h:form>
</h:body>

</html>